#ifndef __X_LEVLE_MGR_H__
#define __X_LEVLE_MGR_H__

enum LevelType
{
	LEVEL_NONE = 0,
	LEVEL_CITY = 1,
	LEVEL_DUP = 2,
	LEVEL_ARENA = 3,
	LEVEL_END
};

enum levelMainType
{
	LMT_CITY = 1,
	LMT_GATE = 2,
};

struct EnterLevelCondition
{
	EnterLevelCondition()
	{
		nOpenLevel = 0;
	}

	U32 nOpenLevel;
};

struct EnterLevelCost
{
	EnterLevelCost()
	{
		nEnergy = 0;
	}
	U32	nEnergy;
};

struct LevelAttr
{
	LevelAttr()
	{
		nLevelID = 0;
		nSenceID = 0;
		eLevelType = LEVEL_NONE;
		eLevelMainType = LMT_CITY;
	}

	U32													nLevelID;
	U32													nSenceID;
	LevelType											eLevelType;
	levelMainType										eLevelMainType;
	EnterLevelCondition									tCondition;
	EnterLevelCost										tCost;
};

#if defined(CLIENT_TYPE)
typedef std::map<U32, LevelAttr*>	LevelList;
#else
typedef boost::unordered_map<U32, LevelAttr*>	LevelList;
#endif

class CLevelMgr
{
	SINGLETON_CLASS(CLevelMgr)
public:
	CLevelMgr();
	~CLevelMgr();

	void Init(std::string& strXMLFile);
	LevelAttr* getLevelTypeById(U32 nLevelId);
	void CreateRoom();

public:
	LevelList		m_mapLevels;
};

#endif //__X_LEVLE_MGR_H__